package week04.homework01MazeGame.model.spell;

import week04.homework01MazeGame.model.role.Monster;
import week04.homework01MazeGame.model.role.Player;

/**
 * @author li
 */
public class FireballSpell extends BaseSpell {
    private static final int DAMAGE = 20;

    public FireballSpell() {
        super(15, "Fireball");
    }

    @Override
    public void cast(Player player, Monster monster) {
        if (player.getMana() >= getManaCost()) {
            player.attack(monster, DAMAGE);
            player.reduceMana(getManaCost());
        } else {
            System.out.println("魔法值不足，无法施放火球术。");
        }
    }

    @Override
    public String getSpellName() {
        return super.getSpellName();
    }

    @Override
    public String getDescription() {
        return super.getDescription() + "，造成" + DAMAGE + "点伤害。";
    }
}
